﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for ClaimDB
/// </summary>
namespace CE.CarInsurance
{
    public class ClaimDB
    {
        public Int64 Insert(Claim claimdetail)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocCarClaimInsertSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@CarMake", claimdetail.CarMakeName);
            _sPara.Add("@CarModel", claimdetail.CarModelName);
            _sPara.Add("@Body", claimdetail.Body);
            _sPara.Add("@CC", claimdetail.CC);
            _sPara.Add("@Door", claimdetail.Door);
            _sPara.Add("@GroupNo", claimdetail.GroupNo);
            _sPara.Add("@MakeModelDesc", claimdetail.MakeModelDesc);
            _sPara.Add("@ManufactYear", claimdetail.ManufactYear);
            _sPara.Add("@Name", claimdetail.Name);
            _sPara.Add("@Email", claimdetail.Email);
            _sPara.Add("@Phone", claimdetail.Phone);
            _sPara.Add("@ClaimInsurerId", claimdetail.ClaimInsurerId);
            _sPara.Add("@AgentId", claimdetail.AgentId);
            if (claimdetail.ExpiryMonth.Trim() != "") _sPara.Add("@ExpiryMonth", claimdetail.ExpiryMonth);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}
